<template>
	<view class="p-2">
		<view class="card bg-white rounded-lg px-2 mb-3">
			<view class="item border-bottom">
				<view class="item-title">头像</view>
				<view class="py-1 flex align-center">
					<image src="../../../../static/img/ic_default_head.png" class="rounded-circle"
						style="width: 100rpx;height: 100rpx;"
						v-if="info.vcHeadImgpath == '' ||info.vcHeadImgpath == 'http://api.sxxat.cn:443' || info.vcHeadImgpath == 'http://api.sxxat.cn:443null' ||  info.vcHeadImgpath == 'http://localhost:8888'||  info.vcHeadImgpath == 'http://localhost:8888null'"
						mode=""></image>
					<image :src="info.vcHeadImgpath" class="rounded-circle" style="width: 100rpx;height: 100rpx;" v-else
						mode=""></image>
				</view>
			</view>
			<view class="item">
				<view class="item-title">姓名</view>
				<view class="item-content">{{info.vcName}}</view>
			</view>
		</view>
		<view class="card bg-white rounded-lg px-2 mb-3">
			<view class="item border-bottom">
				<view class="item-title">学校</view>
				<view class="item-content">{{info.vcXxname}}</view>
			</view>
			<view class="item border-bottom">
				<view class="item-title">班级</view>
				<view class="item-content">{{info.vcBjmc}}</view>
			</view>
			<view class="item">
				<view class="item-title">性别</view>
				<view class="item-content">{{info.vcSex}}</view>
			</view>
		</view>
		<view class="card bg-white rounded-lg px-2 mb-3">
			<view class="item border-bottom">
				<view class="item-title">学号</view>
				<view class="item-content">{{info.vcXh}}</view>
			</view>
			<view class="item border-bottom">
				<view class="item-title">亲情号1</view>
				<view class="item-content">{{info.vcKey1}}</view>
			</view>
			<view class="item border-bottom">
				<view class="item-title">亲情号2</view>
				<view class="item-content">{{info.vcKey2}}</view>
			</view>
			<view class="item border-bottom">
				<view class="item-title">亲情号3</view>
				<view class="item-content">{{info.vcKey3}}</view>
			</view>
			<view class="item border-bottom">
				<view class="item-title">亲情号4</view>
				<view class="item-content">{{info.vcKey4}}</view>
			</view>
			<view class="item">
				<view class="item-title">设备号</view>
				<view class="item-content">{{info.vcSbkh}}</view>
			</view>
		</view>
		<view class="card bg-white rounded-lg px-2 mb-3">
			<view class="item border-bottom">
				<view class="item-title">定位</view>
				<navigator url="./location/location">
					<view class="item-content">查看定位</view>
				</navigator>
			</view>
			<view class="item">
				<view class="item-title">考勤</view>
				<navigator url="../../../keep/keep">
					<view class="item-content">查看考勤</view>
				</navigator>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {}
			}
		},
		methods: {
			getaData(id) {
				let _this = this;
				let opts = {
					url: 'GetXsInfo.shtml'
				};
				let param = {
					xs_id: id
				};
				_this.$http.httpTokenRequest(opts, param).then(
					res => {
						console.log(res.data);
						if (res.data.code == '200') {
							this.info = res.data.data
						} else {
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
						}
					},
					error => {
						console.log(error);
					}
				);
			},
		},
		onLoad(options) {
			uni.setStorage({
				key: 'classUserId',
				data: options.id
			});
			this.getaData(options.id)
		}
	}
</script>

<style>
	page {
		background-color: #f5f5f5;
	}
</style>
<style lang="scss">
	.item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		min-height: 80rpx;
		font-size: 28rpx;
	}

	.item-title {
		color: #333333;
	}

	.item-content {
		color: #666666;
	}
</style>
